<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link href="../css/mui.indexedlist.css" rel="stylesheet" />
		<style>
			html,
			body {
				height: 100%;
				overflow: hidden;
			}
			.mui-bar {
				-webkit-box-shadow: none;
				box-shadow: none;
			}
			#done.mui-disabled{
				color: gray;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">选择机场</h1>
			<a id='done' class="mui-btn mui-btn-link mui-pull-right mui-btn-blue mui-disabled">完成</a>
		</header>
		<div class="mui-content">
			<div id='list' class="mui-indexed-list">
				<div class="mui-indexed-list-search mui-input-row mui-search">
					<input type="search" class="mui-input-clear mui-indexed-list-search-input" placeholder="搜索机场">
				</div>
				<div class="mui-indexed-list-bar" style="display:none;">
					<a>A</a>
					<a>B</a>
					<a>C</a>
					<a>D</a>
					<a>E</a>
					<a>F</a>
					<a>G</a>
					<a>H</a>
					<a>I</a>
					<a>J</a>
					<a>K</a>
					<a>L</a>
					<a>M</a>
					<a>N</a>
					<a>O</a>
					<a>P</a>
					<a>Q</a>
					<a>R</a>
					<a>S</a>
					<a>T</a>
					<a>U</a>
					<a>V</a>
					<a>W</a>
					<a>X</a>
					<a>Y</a>
					<a>Z</a>
				</div>
				<div class="mui-indexed-list-alert"></div>
				<div class="mui-indexed-list-inner">
					<div class="mui-indexed-list-empty-alert">没有数据</div>
					<!--下拉刷新容器-->
		<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
			<div class="mui-scroll" id="scrollContainer">
					<ul class="mui-table-view" style="margin-top:35px;">
						
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />阿克苏机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />阿拉山口机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />阿勒泰机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />阿里昆莎机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />安庆天柱山机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />澳门国际机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />榆林榆阳机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />玉树巴塘机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />运城张孝机场</li>
						
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />湛江机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />昭通机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />郑州新郑国际机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />芷江机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />重庆江北国际机场</li>
						<li class="mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left">
							<input type="checkbox" />中卫香山机场</li>
					
					</ul>
					</div>
					</div>
				</div>
			</div>
		</div>
		<script src="../js/mui.min.js"></script>
		<script src="../js/mui.indexedlist2.js"></script>
		<!--<script src="../js/mui.grouplist.testdata.js"></script>-->
		<script type="text/javascript" charset="utf-8">
			var liArray =[].slice.call(document.querySelectorAll(".mui-table-view li"));
			var list = document.getElementById('list');
			var header = document.querySelector('header.mui-bar');
		  //alert(liArray);
			mui.init({
				pullRefresh: {
					container: '#pullrefresh',
					down: {
						callback: pulldownRefresh
					},
					up: {
						contentrefresh: '正在加载...',
						callback: pullupRefresh
					}
				}
			});
			mui.ready(function() {
				
				
				var done = document.getElementById('done');
				//calc hieght
				list.style.height = (document.body.offsetHeight - header.offsetHeight) + 'px';
				//create
				window.indexedList = new mui.IndexedList(list);
				
			});
			/**
			 * 下拉刷新具体业务实现
			 */
			function pulldownRefresh() {
				setTimeout(function() {
				
					mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
				}, 1500);
			}
			var count = 0;
			/**
			 * 上拉加载具体业务实现
			 */
			function pullupRefresh() {
				setTimeout(function() {
					mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
					var table = document.body.querySelector('.mui-table-view');
					var cells = document.body.querySelectorAll('.mui-table-view-cell');
					for (var i = cells.length, len = i + 15; i < len; i++) {
						var li = document.createElement('li');
						li.className = 'mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left';
						li.innerHTML = '<input type="checkbox" />' + (i + 1);
						table.appendChild(li);
						
						liArray.push(li);
					}
				}, 1500);
			window.indexedList = new mui.IndexedList(list);
			}
		</script>
		
	</body>

</html>